﻿using System.Collections.Generic;

using ProtoBuf;

namespace PnJ.Aliyun.OTS.Models
{
    /// <summary>
    /// 
    /// </summary>
    [ProtoContract(Name = "PutRowRequest")]
    public class PutRowRequest
    {
        public PutRowRequest()
        {

        }
        public PutRowRequest(string tableName)
        {
            this.TableName = tableName;
        }
        private List<Column> primaryKey = new List<Column>();
        private List<Column> attributeColumns = new List<Column>();
        /// <summary>
        /// 请求写入数据的表名
        /// </summary>
        [ProtoMember(1, Name = "table_name", IsRequired = true)]
        public string TableName { get; set; }
        /// <summary>
        /// 在数据写入前是否进行行存在性检查
        /// </summary>
        [ProtoMember(2, Name = "condition", IsRequired = true)]
        public Condition Condition { get; set; }
        /// <summary>
        /// 请求写入的行全部的主键列
        /// </summary>
        [ProtoMember(3, Name = "primary_key")]
        public List<Column> PrimaryKey { get { return primaryKey; } set { primaryKey = value; } }
        /// <summary>
        /// 请求写入的行的属性
        /// </summary>
        [ProtoMember(4, Name = "attribute_columns")]
        public List<Column> AttributeColumns { get { return attributeColumns; } set { attributeColumns = value; } }
    }
}
